Skip to content

Commit

Permalink
Add new pkgpush types to quilt-shared (#3896)
Browse files Browse the repository at this point in the history
  • Loading branch information
sir-sigurd authored Feb 22, 2024
1 parent 5c2b791 commit 7a82dfc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions py-shared/src/quilt_shared/pkgpush.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ class S3ObjectDestination(pydantic.BaseModel):
bucket: str
key: str

@classmethod
def from_pk(cls, pk: PhysicalKey):
if pk.version_id is not None:
raise ValueError("version_id is expected to be None")
return S3ObjectDestination(bucket=pk.bucket, key=pk.path)

@property
def boto_args(self):
return {
Expand All @@ -59,6 +65,12 @@ class S3HashLambdaParams(pydantic.BaseModel):
location: S3ObjectSource


class S3CopyLambdaParams(pydantic.BaseModel):
credentials: AWSCredentials
location: S3ObjectSource
target: S3ObjectDestination


class ChecksumType(str, enum.Enum):
MP = "QuiltMultipartSHA256"
SP = "SHA256"
Expand Down Expand Up @@ -94,6 +106,10 @@ class ChecksumResult(pydantic.BaseModel):
checksum: Checksum


class CopyResult(pydantic.BaseModel):
version: str


class PackagePushParams(pydantic.BaseModel):
bucket: NonEmptyStr
# XXX: validate package name?
Expand Down

0 comments on commit 7a82dfc

Please sign in to comment.