func LateInitialize(s *v1alpha1.TopicParameters, t pubsub.Topic) {
	if len(s.Labels) == 0 && len(t.Labels) != 0 {
		s.Labels = map[string]string{}
		for k, v := range t.Labels {
			s.Labels[k] = v
		}
	}
	if s.KmsKeyName == nil && len(t.KmsKeyName) != 0 {
		s.KmsKeyName = gcp.StringPtr(t.KmsKeyName)
	}
	if s.MessageStoragePolicy == nil && t.MessageStoragePolicy != nil {
		s.MessageStoragePolicy = &v1alpha1.MessageStoragePolicy{AllowedPersistenceRegions: t.MessageStoragePolicy.AllowedPersistenceRegions}
	}
}
LateInitialize fills the empty fields of TopicParameters if the corresponding
fields are given in Topic.
package topic
import (
	"fmt"
	"strings"
	"github.com/google/go-cmp/cmp"
	pubsub "google.golang.org/api/pubsub/v1"
	"github.com/crossplane/provider-gcp/apis/pubsub/v1alpha1"
	gcp "github.com/crossplane/provider-gcp/pkg/clients"
)
const (
	topicNameFormat = "projects/%s/topics/%s"
)
func GetFullyQualifiedName(project string, name string) string {
	return fmt.Sprintf(topicNameFormat, project, name)
}
func GenerateTopic(name string, s v1alpha1.TopicParameters) *pubsub.Topic {
	t := &pubsub.Topic{
		Name:       name,
		Labels:     s.Labels,
		KmsKeyName: gcp.StringValue(s.KmsKeyName),
	}
	if s.MessageStoragePolicy != nil {
		t.MessageStoragePolicy = &pubsub.MessageStoragePolicy{
			AllowedPersistenceRegions: s.MessageStoragePolicy.AllowedPersistenceRegions,
		}
	}
	return t
}