public function getDasetStructure()

in modules/quanthub_sdmx_sync/src/QuanthubSdmxClient.php [107:129]


  public function getDasetStructure(string $urn, $full_detail = FALSE, $references = FALSE) {
    $baseUri = getenv('SDMX_API_URL') . '/workspaces/' . getenv('SDMX_WORKSPACE_ID') . '/registry/sdmx-plus/structure/dataflow/';

    $guzzleClient = $this->httpClientFactory->fromOptions([
      'base_uri' => $baseUri,
      'headers' => $this->headers,
      'query' => [
        'detail' => $full_detail ? 'full' : 'allcompletestubs',
        'references' => $references ? 'all' : 'none',
      ],
    ]);

    $urn_for_url = $this->transformUrn($urn);

    try {
      return json_decode($guzzleClient->get($urn_for_url)->getBody(), TRUE);
    }
    catch (\Exception $e) {
      $this->logger->error('Failed to retrieve dataset structure: @error.', [
        '@error' => $e->getMessage(),
      ]);
    }
  }