code: public static final StreamProperty encodeStreamResponse(String scope, String streamName, final StreamConfiguration streamConfiguration) {
          ScalingConfig scalingPolicy = new ScalingConfig();
          if (streamConfiguration.getScalingPolicy().getScaleType() == ScalingPolicy.ScaleType.FIXED_NUM_SEGMENTS) {
              scalingPolicy.setType(ScalingConfig.TypeEnum.valueOf(streamConfiguration.getScalingPolicy().
                      getScaleType().name()));
              scalingPolicy.setMinSegments(streamConfiguration.getScalingPolicy().getMinNumSegments());
          } else {
              scalingPolicy.setType(ScalingConfig.TypeEnum.valueOf(streamConfiguration.getScalingPolicy().
                      getScaleType().name()));
              scalingPolicy.setTargetRate(streamConfiguration.getScalingPolicy().getTargetRate());
              scalingPolicy.setScaleFactor(streamConfiguration.getScalingPolicy().getScaleFactor());
              scalingPolicy.setMinSegments(streamConfiguration.getScalingPolicy().getMinNumSegments());
          }
  
          RetentionConfig retentionConfig = null;
          if (streamConfiguration.getRetentionPolicy() != null) {
              retentionConfig = new RetentionConfig();
              switch (streamConfiguration.getRetentionPolicy().getRetentionType()) {
                  case SIZE:
                      retentionConfig.setType(RetentionConfig.TypeEnum.LIMITED_SIZE_MB);
                      retentionConfig.setValue(streamConfiguration.getRetentionPolicy().getRetentionParam() / (1024 * 1024));
                      break;
                  case TIME:
                      retentionConfig.setType(RetentionConfig.TypeEnum.LIMITED_DAYS);
                      retentionConfig.setValue(
                              Duration.ofMillis(streamConfiguration.getRetentionPolicy().getRetentionParam()).toDays());
                      break;
              }
          }
  
          StreamProperty streamProperty = new StreamProperty();
          streamProperty.setScopeName(scope);
          streamProperty.setStreamName(streamName);
          streamProperty.setScalingPolicy(scalingPolicy);
          streamProperty.setRetentionPolicy(retentionConfig);
          return streamProperty;
      }
docs: The method translates the internal object StreamConfiguration into REST response object.
  
  @param scope the scope of the stream
  @param streamName the name of the stream
  @param streamConfiguration The configuration of stream
  @return Stream properties wrapped in StreamResponse object