func (m *Merger) GetSyncPeriod() (*time.Duration, error) {
	if m.SyncPeriod == nil && m.SyncPeriodString != "" {
		d, err := time.ParseDuration(m.SyncPeriodString)
		if err != nil {
			return nil, errors.Wrapf(err, "failed to parse duration %s", m.SyncPeriodString)
		}
		m.SyncPeriod = &d
	}
	return m.SyncPeriod, nil
}
GetSyncPeriod returns the sync period, lazily parsing the duration string if required
package v1alpha1
import (
	"time"
	"github.com/jenkins-x/lighthouse-client/pkg/config/job"
	"github.com/pkg/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type Scheduler struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
	Spec SchedulerSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
}
type SchedulerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items []Scheduler `json:"items"`
}
type SchedulerSpec struct {
	SchedulerAgent *SchedulerAgent         `json:"schedulerAgent,omitempty" protobuf:"bytes,1,opt,name=schedulerAgent"`
	Policy         *GlobalProtectionPolicy `json:"policy,omitempty" protobuf:"bytes,2,opt,name=policy"`
	Presubmits     *Presubmits             `json:"presubmits,omitempty" protobuf:"bytes,3,opt,name=presubmits"`
	Postsubmits    *Postsubmits            `json:"postsubmits,omitempty" protobuf:"bytes,4,opt,name=postsubmits"`
	Queries []*Query `json:"queries,omitempty" protobuf:"bytes,5,opt,name=query"`
	MergeMethod *string `json:"merge_method,omitempty" protobuf:"bytes,6,opt,name=merge_method"`
	ProtectionPolicy *ProtectionPolicies `json:"protection_policy,omitempty" protobuf:"bytes,7,opt,name=policy"`
	ContextOptions *RepoContextPolicy `json:"context_options,omitempty" protobuf:"bytes,8,opt,name=contextPolicy"`
	Trigger         *Trigger                           `json:"trigger,omitempty" protobuf:"bytes,9,opt,name=trigger"`
	Approve         *Approve                           `json:"approve,omitempty" protobuf:"bytes,10,opt,name=approve"`
	LGTM            *Lgtm                              `json:"lgtm,omitempty" protobuf:"bytes,11,opt,name=lgtm"`
	ExternalPlugins *ReplaceableSliceOfExternalPlugins `json:"external_plugins,omitempty" protobuf:"bytes,12,opt,name=external_plugins"`
	Merger *Merger `json:"merger,omitempty" protobuf:"bytes,13,opt,name=merger"`
	Plugins       *ReplaceableSliceOfStrings `json:"plugins,omitempty" protobuf:"bytes,14,opt,name=plugins"`
	ConfigUpdater *ConfigUpdater             `json:"config_updater,omitempty" protobuf:"bytes,15,opt,name=config_updater"`
	Welcome       []*Welcome                 `json:"welcome,omitempty" protobuf:"bytes,16,opt,name=welcome"`
	Periodics     *Periodics                 `json:"periodics,omitempty" protobuf:"bytes,17,opt,name=periodics"`
	Attachments   []*Attachment              `json:"attachments,omitempty" protobuf:"bytes,18,opt,name=attachments"`
	InRepo bool `json:"in_repo,omitempty" protobuf:"bytes,19,opt,name=in_repo"`
}
type ConfigMapSpec struct {
	Name string `json:"name"`
	Key string `json:"key,omitempty"`
	Namespace string `json:"namespace,omitempty"`
	AdditionalNamespaces []string `json:"additional_namespaces,omitempty"`
	Namespaces []string `json:"-"`
}
type ConfigUpdater struct {
	Map        map[string]ConfigMapSpec `json:"map,omitempty" protobuf:"bytes,1,opt,name=map"`
	ConfigFile string                   `json:"config_file,omitempty" protobuf:"bytes,2,opt,name=config_file"`
	PluginFile string                   `json:"plugin_file,omitempty" protobuf:"bytes,3,opt,name=plugin_file"`
	ConfigMap ConfigMapSpec
}
type ExternalPlugin struct {
	Name *string `json:"name" protobuf:"bytes,1,opt,name=name"`
	Endpoint *string `json:"endpoint,omitempty" protobuf:"bytes,2,opt,name=endpoint"`
	Events *ReplaceableSliceOfStrings `json:"events,omitempty" protobuf:"bytes,3,opt,name=events"`
}
type ReplaceableSliceOfStrings struct {
	Items []string `json:"entries,omitempty" protobuf:"bytes,1,opt,name=entries"`
	Replace bool `json:"replace,omitempty" protobuf:"bytes,2,opt,name=replace"`
}
type Lgtm struct {
	ReviewActsAsLgtm *bool `json:"review_acts_as_lgtm,omitempty" protobuf:"bytes,1,opt,name=review_acts_as_lgtm"`
	StoreTreeHash *bool `json:"store_tree_hash,omitempty" protobuf:"bytes,2,opt,name=store_tree_hash"`
	StickyLgtmTeam *string `json:"trusted_team_for_sticky_lgtm,omitempty" protobuf:"bytes,3,opt,name=stickyLgtmTeam"`
}
type Approve struct {
	IssueRequired *bool `json:"issue_required,omitempty" protobuf:"bytes,1,opt,name=issue_required"`
	RequireSelfApproval *bool `json:"require_self_approval,omitempty" protobuf:"bytes,2,opt,name=require_self_approval"`
	LgtmActsAsApprove *bool `json:"lgtm_acts_as_approve,omitempty" protobuf:"bytes,3,opt,name=lgtm_acts_as_approve"`
	IgnoreReviewState *bool `json:"ignore_review_state,omitempty" protobuf:"bytes,4,opt,name=ignore_review_state"`
}
type Trigger struct {
	TrustedOrg *string `json:"trusted_org,omitempty" protobuf:"bytes,1,opt,name=trusted_org"`
	JoinOrgURL *string `json:"join_org_url,omitempty" protobuf:"bytes,2,opt,name=join_org_url"`
	OnlyOrgMembers *bool `json:"only_org_members,omitempty" protobuf:"bytes,3,opt,name=only_org_members"`
	IgnoreOkToTest *bool `json:"ignore_ok_to_test,omitempty" protobuf:"bytes,4,opt,name=ignore_ok_to_test"`
	ElideSkippedContexts *bool `json:"elide_skipped_contexts,omitempty"`
}
type Postsubmits struct {
	Items []*job.Postsubmit `json:"entries,omitempty" protobuf:"bytes,1,opt,name=entries"`
	Replace bool `json:"replace,omitempty" protobuf:"bytes,2,opt,name=replace"`
}
type Presubmits struct {
	Items []*job.Presubmit `json:"entries,omitempty" protobuf:"bytes,1,opt,name=entries"`
	Replace bool `json:"replace,omitempty" protobuf:"bytes,2,opt,name=replace"`
}
type Periodics struct {
	Items []*job.Periodic `json:"entries,omitempty" protobuf:"bytes,1,opt,name=entries"`
	Replace bool `json:"replace,omitempty" protobuf:"bytes,2,opt,name=replace"`
}
type Query struct {
	ExcludedBranches       *ReplaceableSliceOfStrings `json:"excludedBranches,omitempty" protobuf:"bytes,1,opt,name=excludedBranches"`
	IncludedBranches       *ReplaceableSliceOfStrings `json:"included_branches,omitempty" protobuf:"bytes,2,opt,name=included_branches"`
	Labels                 *ReplaceableSliceOfStrings `json:"labels,omitempty" protobuf:"bytes,3,opt,name=labels"`
	MissingLabels          *ReplaceableSliceOfStrings `json:"missingLabels,omitempty" protobuf:"bytes,4,opt,name=missingLabels"`
	Milestone              *string                    `json:"milestone,omitempty" protobuf:"bytes,5,opt,name=milestone"`
	ReviewApprovedRequired *bool                      `json:"review_approved_required,omitempty" protobuf:"bytes,6,opt,name=review_approved_required"`
}
type PullRequestMergeType string
const (
	MergeMerge  PullRequestMergeType = "merge"
	MergeRebase PullRequestMergeType = "rebase"
	MergeSquash PullRequestMergeType = "squash"
)
type Merger struct {
	SyncPeriodString string `json:"sync_period,omitempty"`
	SyncPeriod *time.Duration `json:"-"`
	StatusUpdatePeriodString string `json:"status_update_period,omitempty"`
	StatusUpdatePeriod *time.Duration `json:"-"`
	TargetURL *string `json:"target_url,omitempty" protobuf:"bytes,1,opt,name=target_url"`
	PRStatusBaseURL *string `json:"pr_status_base_url,omitempty" protobuf:"bytes,2,opt,name=prStatusBaseURL"`
	BlockerLabel *string `json:"blocker_label,omitempty"`
	SquashLabel *string `json:"squash_label,omitempty"`
	MaxGoroutines *int `json:"max_goroutines,omitempty"`
	MergeType *string `json:"merge_method,omitempty"`
	ContextPolicy *ContextPolicy `json:"policy,omitempty"`
}