Skip to content

Commit

Permalink
chore: type-hint target-opts to remove reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
edporras committed Jun 28, 2024
1 parent cbb440b commit 0ee402d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/clj_gcloud/storage.clj
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,11 @@
;; See: https://cloud.google.com/storage/docs/copying-renaming-moving-objects#storage-copy-object-java
(let [precondition (if-let [target (.get storage target-blob-id)]
(Storage$BlobTargetOption/generationMatch (.getGeneration target))
(Storage$BlobTargetOption/doesNotExist))]
(Storage$BlobTargetOption/doesNotExist))
^Iterable target-opts (into-array Storage$BlobTargetOption [precondition])]
(-> (Storage$CopyRequest/newBuilder)
(.setSource source-blob-id)
(.setTarget target-blob-id (into-array Storage$BlobTargetOption [precondition]))
(.setTarget target-blob-id target-opts)
.build))
(Storage$CopyRequest/of source-blob-id target-blob-id))]
(-> (.copy storage cr)
Expand Down

0 comments on commit 0ee402d

Please sign in to comment.