Exemple #1
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("type");
     writer.WriteStringValue(SystemAssignedServiceIdentityType.ToString());
     writer.WriteEndObject();
 }
Exemple #2
0
        internal static SystemAssignedServiceIdentity DeserializeSystemAssignedServiceIdentity(JsonElement element)
        {
            Optional <Guid> principalId            = default;
            Optional <Guid> tenantId               = default;
            SystemAssignedServiceIdentityType type = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("principalId"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    principalId = property.Value.GetGuid();
                    continue;
                }
                if (property.NameEquals("tenantId"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    tenantId = property.Value.GetGuid();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = new SystemAssignedServiceIdentityType(property.Value.GetString());
                    continue;
                }
            }
            return(new SystemAssignedServiceIdentity(Optional.ToNullable(principalId), Optional.ToNullable(tenantId), type));
        }
Exemple #3
0
 internal SystemAssignedServiceIdentity(Guid?principalId, Guid?tenantId, SystemAssignedServiceIdentityType systemAssignedServiceIdentityType)
 {
     PrincipalId = principalId;
     TenantId    = tenantId;
     SystemAssignedServiceIdentityType = systemAssignedServiceIdentityType;
 }
Exemple #4
0
 public SystemAssignedServiceIdentity(SystemAssignedServiceIdentityType systemAssignedServiceIdentityType)
 {
     SystemAssignedServiceIdentityType = systemAssignedServiceIdentityType;
 }
Exemple #5
0
 public SystemAssignedServiceIdentity(SystemAssignedServiceIdentityType type)
 {
     Type = type;
 }