Pet Profiles & Images
A pet profile belongs to a space and carries the pet’s details, a profile image, and the set of reference images the recogniser is trained on. Images are uploaded to a pre-signed URL and then attached to the profile.
All calls are on Factory.petService.
Pre-requisite: The user has to be signed in to perform the following operations.
Create Pet Profile
To create a new pet profile within a space, The following method can be used:
spaceId(required): The space ID of the User.request(required): Contains pet profile information.
Factory.petService.createPetProfile(
spaceId: String,
request: CreatePetProfileRequest
) -> IVPublisher<PetProfile>
List Pet Profiles
To fetch all pet profiles associated with a space, The following method can be used:
spaceId(required): The space ID of the User.
Factory.petService.listPetProfiles(
spaceId: String
) -> IVPublisher<ListPetProfilesResponse>
Get Pet Profile
To fetch detailed information of a specific pet profile, The following method can be used:
spaceId(required): The space ID of the User.petId(required): The ID of the Pet.
Factory.petService.getPetProfile(
spaceId: String,
petId: String
) -> IVPublisher<PetProfileDetail>
Update Pet Profile
To update an existing pet profile, The following method can be used:
spaceId(required): The space ID of the user.petId(required): The ID of the pet.request(required): Updated pet profile details.
Factory.petService.updatePetProfile(
spaceId: String,
petId: String,
request: UpdatePetProfileRequest
) -> IVPublisher<PetProfile>
Delete Profile Image
To delete the profile image of a pet, The following method can be used:
spaceId(required): The space ID of the user.petId(required): The ID of the pet.
Factory.petService.deleteProfileImage(
spaceId: String,
petId: String
) -> IVPublisher<Void>
Delete Pet Profile
To delete a pet profile, The following method can be used:
spaceId(required): The space ID of the user.petId(required): The ID of the pet.
Factory.petService.deletePetProfile(
spaceId: String,
petId: String
) -> IVPublisher<Void>
Get Pet Image Upload URL
To retrieve a pre-signed URL for uploading a pet image, The following method can be used:
spaceId(required): The space ID of the User.petId(required): The ID of the pet.
Factory.petService.getPetImageUploadURL(
spaceId: String,
petId: String
) -> IVPublisher<GetUploadUrlResponse>
Upload Pet Image
To upload a pet image using a pre-signed URL, The following method can be used:
data(required): The image data to upload.url(required): The pre-signed upload URL.authToken(required): The authorization token for the upload request.id(required): The image ID — becomes the file name (<name>/<id>.jpg).name(required): The folder / prefix the image is stored under. The data must be JPEG.
Factory.petService.uploadImage(
data: Data,
url: String,
authToken: String,
id: String,
name: String
) -> IVPublisher<Void>
Attach Pet Images
To attach uploaded images to a pet profile, The following method can be used:
spaceId(required): The space ID of the User.petId(required): The ID of the pet.imageIds(required): The IDs of the uploaded images.
Factory.petService.attachPetImages(
spaceId: String,
petId: String,
imageIds: [String]
) -> IVPublisher<PetProfileDetail>
Detach Pet Images
To remove associated images from a pet profile, The following method can be used:
spaceId(required): The space ID of the user.petId(required): The ID of the pet.request(required): Contains image detachment details.
Factory.petService.detachPetImages(
spaceId: String,
petId: String,
request: DetachPetImagesRequest
) -> IVPublisher<PetProfileDetail>