# Pages

Pages : `Instance`

## Overview

Pages 객체는 대량의 데이터를 여러 페이지로 나누어 제공하기 위해 사용됩니다.

각 페이지는 키-값 쌍이 정렬된 목록 형태로 구성됩니다.

## Properties

### IsFinished

`boolean`

마지막 페이지인지 여부를 반환합니다.

이를 통해 페이지를 순회할 때, 다음 페이지 요청이 가능한지 여부를 판단할 수 있습니다.

#### Code Samples

```lua
local MarketplaceService = game:GetService("MarketplaceService")

local function Request_GetWorldProductsAsync()
    local success, errorOrWorldProducts = pcall(function()
        return MarketplaceService:GetWorldProductsAsync()
    end)

    if success then
        local worldProducts = errorOrWorldProducts

        while true do
            local currentPage = worldProducts:GetCurrentPage()

            -- 마지막 페이지이면 루프 탈출
            if worldProducts.IsFinished or currentPage == nil then
                break
            end
        end
    end
end
```

## Methods

### AdvanceToNextPageAsync

Pages 객체를 순회하면서 다음 페이지로 이동합니다.

단, 페이지 전환은 남은 페이지가 있을 때만 처리됩니다.

#### Parameters

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

```lua
local MarketplaceService = game:GetService("MarketplaceService")

local function Request_GetWorldProductsAsync()
    local success, errorOrWorldProducts = pcall(function()
        return MarketplaceService:GetWorldProductsAsync()
    end)

    if success then
        local worldProducts = errorOrWorldProducts

        while true do
            local currentPage = worldProducts:GetCurrentPage()

            -- 마지막 페이지이면 루프 탈출
            if worldProducts.IsFinished or currentPage == nil then
                break
            else
                worldProducts:AdvanceToNextPageAsync()
            end
        end
    end
end
```

### GetCurrentPage

현재 페이지에 포함된 모든 항목을 반환합니다.

반환된 항목들의 키 구조는 해당 Pages 객체가 어떤 데이터에서 생성되었는지에 따라 달라집니다.

#### Parameters

#### Return

| `Value` | 현재 페이지에 구성된 정보입니다. |
| ------- | ------------------ |

#### Code Samples

```lua
local MarketplaceService = game:GetService("MarketplaceService")

local function Request_GetWorldProductsAsync()
    local success, errorOrWorldProducts = pcall(function()
        return MarketplaceService:GetWorldProductsAsync()
    end)

    if success then
        local worldProducts = errorOrWorldProducts

        while true do
            local currentPage = worldProducts:GetCurrentPage()

            if currentPage ~= nil then
                for _, productInfo in pairs(currentPage) do
                    print("World Product Name: " .. tostring(productInfo.Name))
                end
            end
        end
    end
end
```

## Events


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overdare.com/korean/development/api-reference/classes/pages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
