Skip to content

Commit

Permalink
fix: fix BidiBlobWriteSessionConfigs to respect preconditions (#2481)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWhitehead authored Apr 1, 2024
1 parent 3b2b259 commit 955d78a
Showing 1 changed file with 81 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,14 @@ public Mapper<WriteObjectRequest.Builder> writeObject() {
};
}

@Override
public Mapper<BidiWriteObjectRequest.Builder> bidiWriteObject() {
return b -> {
b.getObjectChecksumsBuilder().setCrc32C(val);
return b;
};
}

@Override
public int hashCode() {
return Objects.hash(val);
Expand Down Expand Up @@ -753,6 +761,14 @@ public Mapper<WriteObjectRequest.Builder> writeObject() {
};
}

@Override
public Mapper<BidiWriteObjectRequest.Builder> bidiWriteObject() {
return b -> {
customerSuppliedKey(b.getCommonObjectRequestParamsBuilder(), val);
return b;
};
}

@Override
public Mapper<UpdateObjectRequest.Builder> updateObject() {
return b -> {
Expand Down Expand Up @@ -1045,6 +1061,14 @@ public Mapper<WriteObjectRequest.Builder> writeObject() {
};
}

@Override
public Mapper<BidiWriteObjectRequest.Builder> bidiWriteObject() {
return b -> {
b.getWriteObjectSpecBuilder().setIfGenerationMatch(val);
return b;
};
}

@Override
public Mapper<ReadObjectRequest.Builder> readObject() {
return b -> b.setIfGenerationMatch(val);
Expand Down Expand Up @@ -1106,6 +1130,14 @@ public Mapper<WriteObjectRequest.Builder> writeObject() {
};
}

@Override
public Mapper<BidiWriteObjectRequest.Builder> bidiWriteObject() {
return b -> {
b.getWriteObjectSpecBuilder().setIfGenerationNotMatch(val);
return b;
};
}

@Override
public Mapper<ReadObjectRequest.Builder> readObject() {
return b -> b.setIfGenerationNotMatch(val);
Expand Down Expand Up @@ -1157,6 +1189,14 @@ public Mapper<WriteObjectRequest.Builder> writeObject() {
};
}

@Override
public Mapper<BidiWriteObjectRequest.Builder> bidiWriteObject() {
return b -> {
b.getWriteObjectSpecBuilder().getResourceBuilder().setKmsKey(val);
return b;
};
}

@Override
public Mapper<ComposeObjectRequest.Builder> composeObject() {
return b -> b.setKmsKey(val);
Expand Down Expand Up @@ -1217,6 +1257,15 @@ public Mapper<WriteObjectRequest.Builder> writeObject() {
};
}

@Override
public Mapper<BidiWriteObjectRequest.Builder> bidiWriteObject() {
return b -> {
b.getObjectChecksumsBuilder()
.setMd5Hash(ByteString.copyFrom(BaseEncoding.base64().decode(val)));
return b;
};
}

@Override
public int hashCode() {
return Objects.hash(val);
Expand Down Expand Up @@ -1252,6 +1301,14 @@ public Mapper<WriteObjectRequest.Builder> writeObject() {
};
}

@Override
public Mapper<BidiWriteObjectRequest.Builder> bidiWriteObject() {
return b -> {
b.getWriteObjectSpecBuilder().setIfMetagenerationMatch(val);
return b;
};
}

@Override
public Mapper<ReadObjectRequest.Builder> readObject() {
return b -> b.setIfMetagenerationMatch(val);
Expand Down Expand Up @@ -1337,6 +1394,14 @@ public Mapper<WriteObjectRequest.Builder> writeObject() {
};
}

@Override
public Mapper<BidiWriteObjectRequest.Builder> bidiWriteObject() {
return b -> {
b.getWriteObjectSpecBuilder().setIfMetagenerationNotMatch(val);
return b;
};
}

@Override
public Mapper<ReadObjectRequest.Builder> readObject() {
return b -> b.setIfMetagenerationNotMatch(val);
Expand Down Expand Up @@ -1452,6 +1517,14 @@ public Mapper<WriteObjectRequest.Builder> writeObject() {
};
}

@Override
public Mapper<BidiWriteObjectRequest.Builder> bidiWriteObject() {
return b -> {
b.getWriteObjectSpecBuilder().setPredefinedAcl(val);
return b;
};
}

@Override
public Mapper<UpdateObjectRequest.Builder> updateObject() {
return b -> b.setPredefinedAcl(val);
Expand Down Expand Up @@ -1704,6 +1777,14 @@ public Mapper<WriteObjectRequest.Builder> writeObject() {
};
}

@Override
public Mapper<BidiWriteObjectRequest.Builder> bidiWriteObject() {
return b -> {
b.getWriteObjectSpecBuilder().getResourceBuilder().setContentType(val);
return b;
};
}

@Override
public Mapper<UpdateObjectRequest.Builder> updateObject() {
return b -> {
Expand Down

0 comments on commit 955d78a

Please sign in to comment.