| File: Provisioning\ConnectorGateway.cs | Web Access |
| Project: src\src\Aspire.Hosting.Azure.ConnectorNamespace\Aspire.Hosting.Azure.ConnectorNamespace.csproj (Aspire.Hosting.Azure.ConnectorNamespace) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Azure.Core; using Azure.Provisioning; using Azure.Provisioning.Primitives; using Azure.Provisioning.Resources; namespace Aspire.Hosting.Azure.ConnectorNamespace.Provisioning; internal sealed class ConnectorGateway(string bicepIdentifier, string? resourceVersion = null) : ProvisionableResource(bicepIdentifier, "Microsoft.Web/connectorGateways", resourceVersion ?? ConnectorNamespaceResourceVersions.ConnectorGateway) { public BicepValue<ResourceIdentifier> Id { get { Initialize(); return _id!; } } private BicepValue<ResourceIdentifier>? _id; public BicepValue<string> Name { get { Initialize(); return _name!; } set { Initialize(); _name!.Assign(value); } } private BicepValue<string>? _name; public BicepValue<AzureLocation> Location { get { Initialize(); return _location!; } set { Initialize(); _location!.Assign(value); } } private BicepValue<AzureLocation>? _location; public ManagedServiceIdentity Identity { get { Initialize(); return _identity!; } } private ManagedServiceIdentity? _identity; public BicepDictionary<string> Properties { get { Initialize(); return _properties!; } set { Initialize(); _properties!.Assign(value); } } private BicepDictionary<string>? _properties; public BicepDictionary<string> Tags { get { Initialize(); return _tags!; } set { Initialize(); _tags!.Assign(value); } } private BicepDictionary<string>? _tags; public static ConnectorGateway FromExisting(string bicepIdentifier, string? resourceVersion = null) { var resource = new ConnectorGateway(bicepIdentifier, resourceVersion) { IsExistingResource = true }; return resource; } protected override void DefineProvisionableProperties() { base.DefineProvisionableProperties(); _id = DefineProperty<ResourceIdentifier>(nameof(Id), ["id"], isOutput: true); _name = DefineProperty<string>(nameof(Name), ["name"], isRequired: true); _location = DefineProperty<AzureLocation>(nameof(Location), ["location"], isRequired: true); _identity = DefineModelProperty<ManagedServiceIdentity>(nameof(Identity), ["identity"]); _properties = DefineDictionaryProperty<string>(nameof(Properties), ["properties"]); _tags = DefineDictionaryProperty<string>(nameof(Tags), ["tags"]); } }