code: static Glossary createGlossary(String projectId, String location, String name, String gcsUri) {
      try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
  
        LocationName locationName =
            LocationName.newBuilder().setProject(projectId).setLocation(location).build();
        LanguageCodesSet languageCodesSet =
            LanguageCodesSet.newBuilder().addLanguageCodes("en").addLanguageCodes("es").build();
        GcsSource gcsSource = GcsSource.newBuilder().setInputUri(gcsUri).build();
        GlossaryInputConfig glossaryInputConfig =
            GlossaryInputConfig.newBuilder().setGcsSource(gcsSource).build();
        GlossaryName glossaryName =
            GlossaryName.newBuilder()
                .setProject(projectId)
                .setLocation(location)
                .setGlossary(name)
                .build();
        Glossary glossary =
            Glossary.newBuilder()
                .setLanguageCodesSet(languageCodesSet)
                .setInputConfig(glossaryInputConfig)
                .setName(glossaryName.toString())
                .build();
        CreateGlossaryRequest request =
            CreateGlossaryRequest.newBuilder()
                .setParent(locationName.toString())
                .setGlossary(glossary)
                .build();
  
        // Call the API
        Glossary response =
            translationServiceClient.createGlossaryAsync(request).get(300, TimeUnit.SECONDS);
        System.out.format("Created: %s\n", response.getName());
        System.out.format("Input Uri: %s\n", response.getInputConfig().getGcsSource());
        return response;
  
      } catch (Exception e) {
        throw new RuntimeException("Couldn't create client.", e);
      }
    }
docs: [START translate_create_glossary_beta]