pubsub: export snap/seek-related subscription fields

Change-Id: I052fd6dee7024643d33b6ae33571befb13664241
Reviewed-on: https://code-review.googlesource.com/21210
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Michael Darakananda <pongad@google.com>
diff --git a/pubsub/service.go b/pubsub/service.go
index c7c8685..f90a3d3 100644
--- a/pubsub/service.go
+++ b/pubsub/service.go
@@ -123,8 +123,8 @@
 		}
 	}
 	var retentionDuration *durpb.Duration
-	if cfg.retentionDuration != 0 {
-		retentionDuration = ptypes.DurationProto(cfg.retentionDuration)
+	if cfg.RetentionDuration != 0 {
+		retentionDuration = ptypes.DurationProto(cfg.RetentionDuration)
 	}
 
 	_, err := s.subc.CreateSubscription(ctx, &pb.Subscription{
@@ -132,7 +132,7 @@
 		Topic:                    cfg.Topic.name,
 		PushConfig:               rawPushConfig,
 		AckDeadlineSeconds:       trunc32(int64(cfg.AckDeadline.Seconds())),
-		RetainAckedMessages:      cfg.retainAckedMessages,
+		RetainAckedMessages:      cfg.RetainAckedMessages,
 		MessageRetentionDuration: retentionDuration,
 	})
 	return err
@@ -156,8 +156,8 @@
 			Endpoint:   rawSub.PushConfig.PushEndpoint,
 			Attributes: rawSub.PushConfig.Attributes,
 		},
-		retainAckedMessages: rawSub.RetainAckedMessages,
-		retentionDuration:   rd,
+		RetainAckedMessages: rawSub.RetainAckedMessages,
+		RetentionDuration:   rd,
 	}
 	return sub, rawSub.Topic, nil
 }
diff --git a/pubsub/subscription.go b/pubsub/subscription.go
index 2144125..a9b7b6a 100644
--- a/pubsub/subscription.go
+++ b/pubsub/subscription.go
@@ -115,13 +115,13 @@
 
 	// Whether to retain acknowledged messages. If true, acknowledged messages
 	// will not be expunged until they fall out of the RetentionDuration window.
-	retainAckedMessages bool
+	RetainAckedMessages bool
 
-	// How long to retain messages in backlog, from the time of publish. If RetainAckedMessages is true,
-	// this duration affects the retention of acknowledged messages,
-	// otherwise only unacknowledged messages are retained.
+	// How long to retain messages in backlog, from the time of publish. If
+	// RetainAckedMessages is true, this duration affects the retention of
+	// acknowledged messages, otherwise only unacknowledged messages are retained.
 	// Defaults to 7 days. Cannot be longer than 7 days or shorter than 10 minutes.
-	retentionDuration time.Duration
+	RetentionDuration time.Duration
 }
 
 // ReceiveSettings configure the Receive method.