internal PrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType type, PrivateEndpointProperty privateEndpoint, PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState, string groupId, string provisioningState) : base(id, name, type)
 {
     PrivateEndpoint = privateEndpoint;
     PrivateLinkServiceConnectionState = privateLinkServiceConnectionState;
     GroupId           = groupId;
     ProvisioningState = provisioningState;
 }
Esempio n. 2
0
        internal static PrivateEndpointConnectionData DeserializePrivateEndpointConnectionData(JsonElement element)
        {
            ResourceIdentifier id   = default;
            string             name = default;
            ResourceType       type = default;
            Optional <PrivateEndpointProperty> privateEndpoint = default;
            Optional <PrivateLinkServiceConnectionStateProperty> privateLinkServiceConnectionState = default;
            Optional <string> groupId           = default;
            Optional <string> provisioningState = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("privateEndpoint"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            privateEndpoint = PrivateEndpointProperty.DeserializePrivateEndpointProperty(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("privateLinkServiceConnectionState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            privateLinkServiceConnectionState = PrivateLinkServiceConnectionStateProperty.DeserializePrivateLinkServiceConnectionStateProperty(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("groupId"))
                        {
                            groupId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            provisioningState = property0.Value.GetString();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new PrivateEndpointConnectionData(id, name, type, privateEndpoint.Value, privateLinkServiceConnectionState.Value, groupId.Value, provisioningState.Value));
        }
        internal static PrivateEndpointConnectionData DeserializePrivateEndpointConnectionData(JsonElement element)
        {
            ResourceIdentifier             id              = default;
            string                         name            = default;
            ResourceType                   type            = default;
            SystemData                     systemData      = default;
            Optional <WritableSubResource> privateEndpoint = default;
            Optional <PrivateLinkServiceConnectionStateProperty> privateLinkServiceConnectionState = default;
            Optional <PrivateEndpointProvisioningState>          provisioningState = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("privateEndpoint"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            privateEndpoint = JsonSerializer.Deserialize <WritableSubResource>(property0.Value.ToString());
                            continue;
                        }
                        if (property0.NameEquals("privateLinkServiceConnectionState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            privateLinkServiceConnectionState = PrivateLinkServiceConnectionStateProperty.DeserializePrivateLinkServiceConnectionStateProperty(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new PrivateEndpointProvisioningState(property0.Value.GetString());
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new PrivateEndpointConnectionData(id, name, type, systemData, privateEndpoint, privateLinkServiceConnectionState.Value, Optional.ToNullable(provisioningState)));
        }
 internal PrivateEndpointConnection(string id, string name, string type, PrivateEndpointProperty privateEndpoint, PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState) : base(id, name, type)
 {
     PrivateEndpoint = privateEndpoint;
     PrivateLinkServiceConnectionState = privateLinkServiceConnectionState;
 }
Esempio n. 5
0
 public PrivateEndpointConnectionImpl WithStateProperty(PrivateLinkServiceConnectionStateProperty property)
 {
     Inner.PrivateLinkServiceConnectionState = property;
     return(this);
 }
 /// <summary>
 /// Specifies state property.
 /// </summary>
 /// <param name="property">A private link service connection state property.</param>
 /// <return>The next stage of definition.</return>
 PrivateEndpointConnection.Definition.IWithAttach <CosmosDBAccount.Definition.IWithCreate> PrivateEndpointConnection.Definition.IWithState <CosmosDBAccount.Definition.IWithCreate> .WithStateProperty(PrivateLinkServiceConnectionStateProperty property)
 {
     return(this.WithStateProperty(property));
 }
 /// <summary>
 /// Specifies state property.
 /// </summary>
 /// <param name="property">A private link service connection state property.</param>
 /// <return>The next stage of definition.</return>
 PrivateEndpointConnection.UpdateDefinition.IWithAttach <CosmosDBAccount.Update.IWithOptionals> PrivateEndpointConnection.UpdateDefinition.IWithState <CosmosDBAccount.Update.IWithOptionals> .WithStateProperty(PrivateLinkServiceConnectionStateProperty property)
 {
     return(this.WithStateProperty(property));
 }
 /// <summary>
 /// Specifies state property.
 /// </summary>
 /// <param name="property">A private link service connection state property.</param>
 /// <return>The next stage of update.</return>
 PrivateEndpointConnection.Update.IUpdate PrivateEndpointConnection.Update.IWithState.WithStateProperty(PrivateLinkServiceConnectionStateProperty property)
 {
     return(this.WithStateProperty(property));
 }
 internal PrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, WritableSubResource privateEndpoint, PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState, PrivateEndpointProvisioningState?provisioningState) : base(id, name, type, systemData)
 {
     PrivateEndpoint = privateEndpoint;
     PrivateLinkServiceConnectionState = privateLinkServiceConnectionState;
     ProvisioningState = provisioningState;
 }