## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(eval = FALSE, collapse = TRUE, comment = "#>")

## ----profile------------------------------------------------------------------
# library(tuiksdmx)
# profile <- tuik_flow_profile("DF_TUFE_SDMX_TT01")

## ----definitions--------------------------------------------------------------
# # All listed values are structurally defined, not necessarily observed.
# defined <- tuik_dimension_codes(profile, dimension = "COICOP_2018")
# defined

## ----observed-----------------------------------------------------------------
# # No filters: explicit opt-in because this inspects an `all` response.
# observed <- tuik_available_codes(
#   profile,
#   dimension = "COICOP_2018",
#   start_period = "2026-01",
#   end_period = "2026-01",
#   allow_all = TRUE
# )
# observed

## ----partial------------------------------------------------------------------
# selected <- tuik_available_codes(
#   profile,
#   dimension = "COICOP_2018",
#   start_period = "2026-01",
#   end_period = "2026-01",
#   filters = list(REF_AREA = "TR", FREQ = "M"),
#   allow_all = TRUE,
#   query_mode = "auto"
# )
# selected

## ----full-key-----------------------------------------------------------------
# filters <- list(
#   REF_AREA = "TR", FREQ = "M", SINIFLAMA_DUZEYI = "2",
#   DEGISIM = "1", OZEL_KAPSAM_TUFE = "_Z", BASE_PER = "2025",
#   YAYIM_DONEMI = "2026_01", COICOP_1999 = "_Z",
#   COICOP_2018 = "01", INDICATOR = "F_TFE"
# )
# 
# # Check the referenced Codelists before calling the service.
# tuik_validate_filters(profile, filters)
# 
# available_in_key <- tuik_available_codes(
#   profile,
#   dimension = "COICOP_2018",
#   start_period = "2026-01",
#   end_period = "2026-01",
#   filters = filters,
#   query_mode = "auto"
# )
# available_in_key

