/*
 * Copyright 2017 Google, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.netflix.spinnaker.echo.pubsub;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.stream.Collectors;

/**
 * Controller for configured pub/sub subscriptions.
 */
@RestController
public class PubsubSubscriptionController {

  @Autowired
  private PubsubSubscribers pubsubSubscribers;

  @RequestMapping(value = "/pubsub/subscriptions", method = RequestMethod.GET)
  List<String> getSubscriptions() {
    return pubsubSubscribers.getAll().stream().map(s -> s.getName()).collect(Collectors.toList());
  }
}

@@ -634,16 +634,126 @@
 ubsub;%0A%0A
+import lombok.AllArgsConstructor;%0Aimport lombok.Builder;%0Aimport lombok.Data;%0Aimport lombok.NoArgsConstructor;%0A
 import o
@@ -807,16 +807,16 @@
 owired;%0A
-
 import o
@@ -1328,14 +1328,34 @@
 ist%3C
-String
+PubsubSubscriptionBySystem
 %3E ge
@@ -1405,77 +1405,439 @@
 bers
-.getAll().stream().map(s -%3E s.getName()).collect(Collectors.toList())
+%0A        .getAll()%0A        .stream()%0A        .map(s -%3E PubsubSubscriptionBySystem.builder()%0A          .pubsubSystem(s.pubsubSystem().toString())%0A          .subscriptionName(s.getName())%0A          .build())%0A        .collect(Collectors.toList());%0A  %7D%0A%0A  @Data%0A  @Builder%0A  @NoArgsConstructor%0A  @AllArgsConstructor%0A  public static class PubsubSubscriptionBySystem %7B%0A    private String pubsubSystem;%0A    private String subscriptionName
 ;%0A  

Change /pubsub/subscriptions API to return a list of a datatype containing pubsubSystem and subscriptionName fields. (#260)