import { z } from "zod"; import { endpoint } from ".."; const Roblox_Api_Avatar_Models_AssetTypeModel = z.object({ id: z.number().int(), name: z.string(), }); const Roblox_Api_Avatar_Models_AssetPosition = z.object({ X: z.number(), Y: z.number(), Z: z.number(), }); const Roblox_Api_Avatar_Models_AssetRotation = z.object({ X: z.number(), Y: z.number(), Z: z.number(), }); const Roblox_Api_Avatar_Models_AssetScale = z.object({ X: z.number(), Y: z.number(), Z: z.number(), }); const Roblox_Api_Avatar_Models_AssetMetaModelV1 = z.object({ order: z.number().int(), puffiness: z.number(), position: Roblox_Api_Avatar_Models_AssetPosition, rotation: Roblox_Api_Avatar_Models_AssetRotation, scale: Roblox_Api_Avatar_Models_AssetScale, headShape: z.union([ z.literal(0), z.literal(1), z.literal(2), z.literal(3), z.literal(4), z.literal(5), z.literal(6), z.literal(7), z.literal(8), z.literal(9), z.literal(10), z.literal(11), z.literal(12), z.literal(13), z.literal(14), z.literal(15), z.literal(16), z.literal(17), z.literal(18), z.literal(19), z.literal(20), z.literal(21), z.literal(22), z.literal(23), z.literal(24), z.literal(25), z.literal(26), z.literal(27), z.literal(28), z.literal(29), ]), staticFacialAnimation: z.boolean(), version: z.number().int(), }); const Roblox_Api_Avatar_Models_AssetModelV2 = z.object({ id: z.number().int(), name: z.string(), assetType: Roblox_Api_Avatar_Models_AssetTypeModel, currentVersionId: z.number().int(), meta: Roblox_Api_Avatar_Models_AssetMetaModelV1, availabilityStatus: z.string(), expirationTime: z.string().datetime({ offset: true }), supportsHeadShapes: z.boolean(), }); const Roblox_Api_Avatar_Models_BodyColors3Model = z.object({ headColor3: z.string(), torsoColor3: z.string(), rightArmColor3: z.string(), leftArmColor3: z.string(), rightLegColor3: z.string(), leftLegColor3: z.string(), }); const Roblox_Web_Responses_Avatar_ScaleModel = z.object({ height: z.number(), width: z.number(), head: z.number(), depth: z.number(), proportion: z.number(), bodyType: z.number(), }); const Roblox_Api_Avatar_Models_OutfitDetailsModelV2 = z.object({ id: z.number().int(), name: z.string(), assets: z.array(Roblox_Api_Avatar_Models_AssetModelV2), bodyColor3s: Roblox_Api_Avatar_Models_BodyColors3Model, scale: Roblox_Web_Responses_Avatar_ScaleModel, playerAvatarType: z.string(), outfitType: z.string(), isEditable: z.boolean(), universeId: z.number().int(), moderationStatus: z.string(), bundleId: z.number().int(), inventoryType: z.string(), }); const Roblox_Api_Avatar_Models_AssetWearModel = z.object({ id: z.number().int(), meta: Roblox_Api_Avatar_Models_AssetMetaModelV1, }); const Roblox_Api_Avatar_Models_OutfitUpdateModelV3 = z.object({ name: z.string(), bodyColor3s: Roblox_Api_Avatar_Models_BodyColors3Model, assets: z.array(Roblox_Api_Avatar_Models_AssetWearModel), scale: Roblox_Web_Responses_Avatar_ScaleModel, playerAvatarType: z.string(), outfitType: z.union([ z.literal(0), z.literal(1), z.literal(2), z.literal(4), z.literal(5), ]), }); const Roblox_Api_Avatar_Models_OutfitModel = z.object({ id: z.number().int(), name: z.string(), isEditable: z.boolean(), outfitType: z.string(), }); /** * @api PATCH https://avatar.roblox.com/v3/outfits/:userOutfitId * @summary Updates the contents of an outfit. * @param body The updated outfit. * @param userOutfitId The user outfit id. * @param Roblox-Place-Id * @description Fails if the user does not own any of the assetIds or if they are not wearable asset types. Accepts partial updates. */ export const patchOutfitsUseroutfitid = endpoint({ method: "PATCH", path: "/v3/outfits/:userOutfitId", baseUrl: "https://avatar.roblox.com", requestFormat: "json", serializationMethod: { body: {}, userOutfitId: { style: "simple", }, "Roblox-Place-Id": { style: "simple", }, }, parameters: { userOutfitId: z.number().int(), "Roblox-Place-Id": z.number().int().optional(), }, body: Roblox_Api_Avatar_Models_OutfitUpdateModelV3, response: Roblox_Api_Avatar_Models_OutfitModel, errors: [ { status: 400, description: `3: Body colors must be valid BrickColor IDs 4: Invalid outfit name 5: Asset is not wearable by you 8: Invalid Player Avatar Type. Valid types are R6 and R15 11: Meta does not apply to specified asset type 12: Meta is required for this specific asset type 13: Invalid Outfit Type 14: Invalid scale`, }, { status: 401, description: `0: Authorization has been denied for this request.`, }, { status: 403, description: `0: Token Validation Failed 2: You don't have permission to update this outfit.`, }, { status: 404, description: `1: The specified userOutfit does not exist!`, }, { status: 500, description: `6: An error occurred while trying to update the outfit`, }, ], }); /** * @api GET https://avatar.roblox.com/v3/outfits/:userOutfitId/details * @summary Gets details about the contents of an outfit. * @param userOutfitId The user outfit id. * @param Roblox-Place-Id * @param checkAssetAvailability Whether to return assets with availability status. */ export const getOutfitsUseroutfitidDetails = endpoint({ method: "GET", path: "/v3/outfits/:userOutfitId/details", baseUrl: "https://avatar.roblox.com", requestFormat: "json", serializationMethod: { userOutfitId: { style: "simple", }, "Roblox-Place-Id": { style: "simple", }, checkAssetAvailability: { style: "form", explode: true, }, }, parameters: { userOutfitId: z.number().int(), "Roblox-Place-Id": z.number().int().optional(), checkAssetAvailability: z.boolean().optional(), }, response: Roblox_Api_Avatar_Models_OutfitDetailsModelV2, errors: [ { status: 400, description: `2: The outfit for the specified userOutfit is invalid.`, }, { status: 403, description: `3: The requester does not have access to the details for the given user outfit.`, }, { status: 404, description: `1: The specified userOutfitId is invalid.`, }, ], }); /** * @api POST https://avatar.roblox.com/v3/outfits/create * @summary Creates a new outfit. * @param body The new outfit. * @param Roblox-Place-Id * @description Fails if any of the assetIds are not owned by the user, or not wearable types. The name property of the request is optional as one will be auto-generated when the request has a null name. */ export const postOutfitsCreate = endpoint({ method: "POST", path: "/v3/outfits/create", baseUrl: "https://avatar.roblox.com", requestFormat: "json", serializationMethod: { body: {}, "Roblox-Place-Id": { style: "simple", }, }, parameters: { "Roblox-Place-Id": z.number().int().optional(), }, body: Roblox_Api_Avatar_Models_OutfitUpdateModelV3, response: Roblox_Api_Avatar_Models_OutfitModel, errors: [ { status: 400, description: `3: Body colors must be valid BrickColor IDs 4: Invalid outfit name 5: Asset is not wearable by you and was not added to the outfit 7: Invalid Player Avatar Type. Valid types are R6 and R15 8: Invalid assetIds 9: Meta does not apply to specified asset type 10: Required meta is not provided for the specific asset type 12: Outfit type invalid or not permitted 13: Invalid Scale`, }, { status: 401, description: `0: Authorization has been denied for this request.`, }, { status: 403, description: `0: Token Validation Failed 1: You already have the maximum number of outfits`, }, { status: 500, description: `6: An error occurred while creating the outfit`, }, ], });