// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <fidl/test/unionflexiblestrict/llcpp/fidl.h>  // nogncheck
namespace fidl_test = fidl_test_unionflexiblestrict;

// [START contents]
void use_union(fidl_test::wire::JsonValue* value) {
  switch (value->which()) {
    case fidl_test::wire::JsonValue::Tag::kIntValue:
      printf("int value: %d\n", value->int_value());
      break;
    case fidl_test::wire::JsonValue::Tag::kStringValue:
      printf("string value: %s\n", value->string_value().data());
      break;
    case fidl_test::wire::JsonValue::Tag::kUnknown:
      printf("<unknown data>\n");
      break;
  }
}
// [END contents]

int main(int argc, const char** argv) { return 0; }
