@@ -0,0 +1,2246 @@
+/*%0A * Copyright 2020 Google LLC%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.example.servicedirectory;%0A%0A// %5BSTART servicedirectory_quickstart%5D%0A%0Aimport com.google.cloud.servicedirectory.v1beta1.LocationName;%0Aimport com.google.cloud.servicedirectory.v1beta1.Namespace;%0Aimport com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient;%0Aimport com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListNamespacesPagedResponse;%0Aimport java.io.IOException;%0A%0Apublic class Quickstart %7B%0A%0A  public static void quickstart() throws IOException %7B%0A    // TODO(developer): Replace these variables before running the sample.%0A    String projectId = %22your-project-id%22;%0A    String locationId = %22your-region%22;%0A    quickstart(projectId, locationId);%0A  %7D%0A%0A  public static void quickstart(String projectId, String locationId) throws IOException %7B%0A    // Initialize client that will be used to send requests. This client only needs to be created%0A    // once, and can be reused for multiple requests. After completing all of your requests, call%0A    // the %22close%22 method on the client to safely clean up any remaining background resources.%0A    try (RegistrationServiceClient client = RegistrationServiceClient.create()) %7B%0A%0A      // The project and location that hold the namespace to list.%0A      LocationName parent = LocationName.of(projectId, locationId);%0A%0A      // Call the API.%0A      ListNamespacesPagedResponse response = client.listNamespaces(parent);%0A%0A      // Iterate over each namespace and print its name.%0A      System.out.println(%22Namespaces:%22);%0A      for (Namespace namespace : response.iterateAll()) %7B%0A        System.out.println(namespace.getName());%0A      %7D%0A    %7D%0A  %7D%0A%7D%0A// %5BEND servicedirectory_quickstart%5D%0A

add quickstart (#82)