import { z } from "zod"; import { endpoint } from ".."; const Roblox_AccountSettings_Api_Models_Response_UserAccountCountry = z.object({ countryName: z.string(), subdivisionIso: z.string(), localizedSubdivision: z.string(), localizedName: z.string(), countryId: z.number().int(), }); const Roblox_AccountSettings_Api_Models_Response_AccountCountrySettingsResponse = z.object({ value: Roblox_AccountSettings_Api_Models_Response_UserAccountCountry, }); const Roblox_AccountSettings_Api_UpdateAccountCountryRequest = z.object({ targetCountryId: z.number().int(), }); const Roblox_AccountSettings_Api_Models_Response_UpdateAccountCountryResponse = z.object({}); const Roblox_AccountSettings_Api_Models_AccountsSettingsMetadataModel = z.object({ IsAccountsRestrictionsSpamBugFixEnabled: z.boolean(), MaximumParentalControlsMonthlySpendLimitInUSD: z.number().int(), IsParentalMonthlyLimitInUIEnabled: z.boolean(), IsParentalNotificationSettingsInUIEnabled: z.boolean(), IsContentControlsEnabled: z.boolean(), }); const Roblox_AccountSettings_Api_EmailResponse = z.object({ emailAddress: z.string(), verified: z.boolean(), canBypassPasswordForEmailUpdate: z.boolean(), }); const Roblox_AccountSettings_Api_UpdateEmailRequest = z.object({ password: z.string(), emailAddress: z.string(), skipVerificationEmail: z.boolean(), isAdsAccount: z.boolean(), }); const Roblox_Web_WebAPI_ApiEmptyResponseModel = z.object({}); const Roblox_AccountSettings_Api_CurrentEmailsResponse = z.object({ verifiedEmail: z.string(), pendingEmail: z.string(), }); const Roblox_AccountSettings_Api_ThemeConfigurationResponse = z.object({ themeType: z.string(), }); const Roblox_AccountSettings_Api_ThemeConfigurationRequest = z.object({ themeType: z.string(), }); const Roblox_Web_WebAPI_Models_ApiArrayResponse_System_String_ = z.object({ data: z.array(z.string()), }); const Roblox_AccountSettings_Api_TradePrivacyResponse = z.object({ tradePrivacy: z.string(), }); const Roblox_AccountSettings_Api_UpdateTradePrivacyRequest = z.object({ tradePrivacy: z.enum([ "Undefined", "Disabled", "NoOne", "Friends", "TopFriends", "Following", "Followers", "All", ]), }); const Roblox_AccountSettings_Api_TradePrivacyUpdateResponse = z.object({ tradePrivacy: z.enum([ "Undefined", "Disabled", "NoOne", "Friends", "TopFriends", "Following", "Followers", "All", ]), inventoryPrivacy: z.enum([ "NoOne", "Friends", "FriendsAndFollowing", "FriendsFollowingAndFollowers", "AllAuthenticatedUsers", "AllUsers", ]), privacySettingResponse: z.enum(["Success", "Conflict"]), }); const Roblox_AccountSettings_Api_TradeValueResponse = z.object({ tradeValue: z.string(), }); const Roblox_AccountSettings_Api_TradeValueRequest = z.object({ tradeValue: z.enum(["Undefined", "None", "Low", "Medium", "High"]), }); const Roblox_AccountSettings_Api_SendVerifyEmailRequest = z.object({ freeItem: z.boolean(), isAdsAccount: z.boolean(), }); /** * @api GET https://accountsettings.roblox.com/v1/account/settings/account-country * @summary Get a user's current account country setting. */ export const getAccountSettingsAccountCountry = endpoint({ method: "GET", path: "/v1/account/settings/account-country", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", response: Roblox_AccountSettings_Api_Models_Response_AccountCountrySettingsResponse, errors: [ { status: 401, description: `0: Authorization has been denied for this request.`, }, ], }); /** * @api POST https://accountsettings.roblox.com/v1/account/settings/account-country * @summary Updates the user's account country. * @param body */ export const postAccountSettingsAccountCountry = endpoint({ method: "POST", path: "/v1/account/settings/account-country", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", serializationMethod: { body: {}, }, parameters: {}, body: z.object({ targetCountryId: z.number().int() }), response: z.object({}), errors: [ { status: 400, description: `1: InvalidRequest`, }, { status: 401, description: `0: Authorization has been denied for this request.`, }, { status: 403, description: `0: Token Validation Failed 2: OperationNotPermitted`, }, { status: 404, description: `2: OperationNotPermitted`, }, { status: 500, description: `0: Unknown`, }, ], }); /** * @api GET https://accountsettings.roblox.com/v1/account/settings/metadata * @summary Returns metadata used by the account settings page */ export const getAccountSettingsMetadata = endpoint({ method: "GET", path: "/v1/account/settings/metadata", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", response: Roblox_AccountSettings_Api_Models_AccountsSettingsMetadataModel, errors: [ { status: 401, description: `0: Authorization has been denied for this request.`, }, ], }); /** * @api GET https://accountsettings.roblox.com/v1/email * @summary Gets the authenticated user's email address and verified status */ export const getEmail = endpoint({ method: "GET", path: "/v1/email", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", response: Roblox_AccountSettings_Api_EmailResponse, errors: [ { status: 401, description: `0: Authorization has been denied for this request.`, }, ], }); /** * @api POST https://accountsettings.roblox.com/v1/email * @summary Updates the authenticated user's email address * @param body The request body. */ export const postEmail = endpoint({ method: "POST", path: "/v1/email", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", serializationMethod: { body: {}, }, parameters: {}, body: Roblox_AccountSettings_Api_UpdateEmailRequest, response: z.object({}), errors: [ { status: 400, description: `8: Password is incorrect. 9: Invalid email address.`, }, { status: 401, description: `0: Authorization has been denied for this request.`, }, { status: 403, description: `0: Token Validation Failed 2: This feature is currently disabled. Please try again later. 3: There are too many accounts associated with this email address. 11: You must be on the Corporate network to log in.`, }, { status: 409, description: `4: This is already the current email.`, }, { status: 429, description: `6: Too many attempts to update email. Please try again later. 7: Too many attempts to send verification email. Please try again later.`, }, { status: 503, description: `2: This feature is currently disabled. Please try again later.`, }, ], }); /** * @api PATCH https://accountsettings.roblox.com/v1/email * @summary Updates the authenticated user's email address * @param body The request body. */ export const patchEmail = endpoint({ method: "PATCH", path: "/v1/email", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", serializationMethod: { body: {}, }, parameters: {}, body: Roblox_AccountSettings_Api_UpdateEmailRequest, response: z.object({}), errors: [ { status: 400, description: `8: Password is incorrect. 9: Invalid email address.`, }, { status: 401, description: `0: Authorization has been denied for this request.`, }, { status: 403, description: `0: Token Validation Failed 2: This feature is currently disabled. Please try again later. 3: There are too many accounts associated with this email address. 11: You must be on the Corporate network to log in.`, }, { status: 409, description: `4: This is already the current email.`, }, { status: 429, description: `6: Too many attempts to update email. Please try again later. 7: Too many attempts to send verification email. Please try again later.`, }, { status: 503, description: `2: This feature is currently disabled. Please try again later.`, }, ], }); /** * @api POST https://accountsettings.roblox.com/v1/email/verify * @summary Send verify email to the authenticated user's email address * @param body The request body. */ export const postEmailVerify = endpoint({ method: "POST", path: "/v1/email/verify", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", serializationMethod: { body: {}, }, parameters: {}, body: Roblox_AccountSettings_Api_SendVerifyEmailRequest.optional(), response: z.object({}), errors: [ { status: 400, description: `10: No email address is associated with the account.`, }, { status: 401, description: `0: Authorization has been denied for this request.`, }, { status: 403, description: `0: Token Validation Failed 2: This feature is currently disabled. Please try again later. 11: You must be on the Corporate network to log in.`, }, { status: 409, description: `5: The email is already verified.`, }, { status: 429, description: `7: Too many attempts to send verification email. Please try again later.`, }, { status: 503, description: `2: This feature is currently disabled. Please try again later.`, }, ], }); /** * @api GET https://accountsettings.roblox.com/v1/emails * @summary Gets the authenticated user's verified email and pending (unverified) email if one exists */ export const getEmails = endpoint({ method: "GET", path: "/v1/emails", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", response: Roblox_AccountSettings_Api_CurrentEmailsResponse, errors: [ { status: 401, description: `0: Authorization has been denied for this request.`, }, ], }); /** * @api GET https://accountsettings.roblox.com/v1/themes/:consumerType/:consumerId * @summary returns the theme type for a specific consumer. * @param consumerType The consumer type * @param consumerId The consumer's theme configuration to get. If the consumerType is User always return the AuthenticatedUser's theme type. */ export const getThemesConsumertypeConsumerid = endpoint({ method: "GET", path: "/v1/themes/:consumerType/:consumerId", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", serializationMethod: { consumerType: { style: "simple", }, consumerId: { style: "simple", }, }, parameters: { consumerType: z.literal(1), consumerId: z.string(), }, response: z.object({ themeType: z.string() }), errors: [ { status: 400, description: `3: Invalid consumer type.`, }, { status: 401, description: `0: Authorization has been denied for this request.`, }, ], }); /** * @api PATCH https://accountsettings.roblox.com/v1/themes/:consumerType/:consumerId * @summary Modify the theme type for consumer. * @param body An Roblox.AccountSettings.Api.ThemeConfigurationRequest. * @param consumerType The consumer type * @param consumerId The consumer's theme configuration to modify. If the consumerType is User always modify the AuthenticatedUser's theme type. */ export const patchThemesConsumertypeConsumerid = endpoint({ method: "PATCH", path: "/v1/themes/:consumerType/:consumerId", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", serializationMethod: { body: {}, consumerType: { style: "simple", }, consumerId: { style: "simple", }, }, parameters: { consumerType: z.literal(1), consumerId: z.number().int(), }, body: z.object({ themeType: z.string() }), response: z.object({}), errors: [ { status: 400, description: `2: Invalid theme type.`, }, { status: 401, description: `0: Authorization has been denied for this request.`, }, { status: 403, description: `0: Token Validation Failed`, }, ], }); /** * @api GET https://accountsettings.roblox.com/v1/themes/types * @summary returns all the enabled theme types. */ export const getThemesTypes = endpoint({ method: "GET", path: "/v1/themes/types", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", response: Roblox_Web_WebAPI_Models_ApiArrayResponse_System_String_, errors: [], }); /** * @api GET https://accountsettings.roblox.com/v1/trade-privacy * @summary Get a user's trade privacy setting */ export const getTradePrivacy = endpoint({ method: "GET", path: "/v1/trade-privacy", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", response: z.object({ tradePrivacy: z.string() }), errors: [ { status: 401, description: `0: Authorization has been denied for this request.`, }, ], }); /** * @api POST https://accountsettings.roblox.com/v1/trade-privacy * @summary Updates a user's trade privacy setting * @param body */ export const postTradePrivacy = endpoint({ method: "POST", path: "/v1/trade-privacy", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", serializationMethod: { body: {}, }, parameters: {}, body: Roblox_AccountSettings_Api_UpdateTradePrivacyRequest, response: Roblox_AccountSettings_Api_TradePrivacyUpdateResponse, errors: [ { status: 400, description: `Roblox.AccountSettings.Api.ResponseEnums.TradeSettingsErrors.InvalidTradePrivacy`, }, { status: 401, description: `0: Authorization has been denied for this request.`, }, { status: 403, description: `Roblox.AccountSettings.Api.ResponseEnums.TradeSettingsErrors.AccountLocked OR Roblox.AccountSettings.Api.ResponseEnums.TradeSettingsErrors.UserCannotTrade 0: Token Validation Failed`, }, ], }); /** * @api GET https://accountsettings.roblox.com/v1/trade-value * @summary Get a user's trade quality filter setting */ export const getTradeValue = endpoint({ method: "GET", path: "/v1/trade-value", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", response: z.object({ tradeValue: z.string() }), errors: [ { status: 401, description: `0: Authorization has been denied for this request.`, }, ], }); /** * @api POST https://accountsettings.roblox.com/v1/trade-value * @summary Updates a user's trade quality filter setting * @param body */ export const postTradeValue = endpoint({ method: "POST", path: "/v1/trade-value", baseUrl: "https://accountsettings.roblox.com", requestFormat: "json", serializationMethod: { body: {}, }, parameters: {}, body: Roblox_AccountSettings_Api_TradeValueRequest, response: z.object({}), errors: [ { status: 400, description: `Roblox.AccountSettings.Api.ResponseEnums.TradeSettingsErrors.InvalidTradeValue`, }, { status: 401, description: `0: Authorization has been denied for this request.`, }, { status: 403, description: `Roblox.AccountSettings.Api.ResponseEnums.TradeSettingsErrors.AccountLocked OR Roblox.AccountSettings.Api.ResponseEnums.TradeSettingsErrors.UserCannotTrade 0: Token Validation Failed`, }, ], });