internal static CopyOperationResult DeserializeCopyOperationResult(JsonElement element) { OperationStatus status = default; DateTimeOffset createdDateTime = default; DateTimeOffset lastUpdatedDateTime = default; Optional <CopyResult> copyResult = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("status")) { status = property.Value.GetString().ToOperationStatus(); continue; } if (property.NameEquals("createdDateTime")) { createdDateTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("lastUpdatedDateTime")) { lastUpdatedDateTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("copyResult")) { copyResult = CopyResult.DeserializeCopyResult(property.Value); continue; } } return(new CopyOperationResult(status, createdDateTime, lastUpdatedDateTime, copyResult.Value)); }
internal CopyOperationResult(OperationStatus status, DateTimeOffset createdDateTime, DateTimeOffset lastUpdatedDateTime, CopyResult copyResult) { Status = status; CreatedDateTime = createdDateTime; LastUpdatedDateTime = lastUpdatedDateTime; CopyResult = copyResult; }