void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("type"); writer.WriteStringValue(SystemAssignedServiceIdentityType.ToString()); writer.WriteEndObject(); }
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)); }
internal SystemAssignedServiceIdentity(Guid?principalId, Guid?tenantId, SystemAssignedServiceIdentityType systemAssignedServiceIdentityType) { PrincipalId = principalId; TenantId = tenantId; SystemAssignedServiceIdentityType = systemAssignedServiceIdentityType; }
public SystemAssignedServiceIdentity(SystemAssignedServiceIdentityType systemAssignedServiceIdentityType) { SystemAssignedServiceIdentityType = systemAssignedServiceIdentityType; }
public SystemAssignedServiceIdentity(SystemAssignedServiceIdentityType type) { Type = type; }