func toStorageIdentity(i *Identity) *storage.Identity {
	if i == nil {
		return nil
	}
	return &storage.Identity{
		PrincipalID: toStringPtr(i.PrincipalID),
		TenantID:    toStringPtr(i.TenantID),
		Type:        toStringPtr(i.Type),
	}
}
toStorageIdentity convert to storage equivalent
package v1alpha3
import (
	"encoding/json"
	"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-06-01/storage"
	"github.com/Azure/go-autorest/autorest/date"
	"github.com/Azure/go-autorest/autorest/to"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type CustomDomain struct {
	Name string `json:"name,omitempty"`
	UseSubDomainName bool `json:"useSubDomainName,omitempty"`
}
func newCustomDomain(d *storage.CustomDomain) *CustomDomain {
	if d == nil {
		return nil
	}
	return &CustomDomain{
		Name:             to.String(d.Name),
		UseSubDomainName: to.Bool(d.UseSubDomainName),
	}
}
func toStorageCustomDomain(c *CustomDomain) *storage.CustomDomain {
	if c == nil {
		return nil
	}
	return &storage.CustomDomain{
		Name:             toStringPtr(c.Name),
		UseSubDomainName: to.BoolPtr(c.UseSubDomainName),
	}
}
type EnabledEncryptionServices struct {
	Blob bool `json:"blob,omitempty"`
	File bool `json:"file,omitempty"`
}
func newEnabledEncryptionServices(s *storage.EncryptionServices) *EnabledEncryptionServices {
	if s == nil {
		return nil
	}
	b := func(s *storage.EncryptionService) bool {
		return s != nil && s.Enabled != nil && *s.Enabled
	}
	return &EnabledEncryptionServices{
		Blob: b(s.Blob),
		File: b(s.File),
	}
}
func toStorageEncryptedServices(s *EnabledEncryptionServices) *storage.EncryptionServices {
	return &storage.EncryptionServices{
		Blob: &storage.EncryptionService{Enabled: to.BoolPtr(s.Blob)},
		File: &storage.EncryptionService{Enabled: to.BoolPtr(s.File)},
	}
}
type Encryption struct {
	Services *EnabledEncryptionServices `json:"services,omitempty"`
	KeySource storage.KeySource `json:"keySource,omitempty"`
	KeyVaultProperties *KeyVaultProperties `json:"keyvaultproperties,omitempty"`
}
func newEncryption(s *storage.Encryption) *Encryption {
	if s == nil {
		return nil
	}
	return &Encryption{
		Services:           newEnabledEncryptionServices(s.Services),
		KeySource:          s.KeySource,
		KeyVaultProperties: newKeyVaultProperties(s.KeyVaultProperties),
	}
}
func toStorageEncryption(e *Encryption) *storage.Encryption {
	if e == nil {
		return nil
	}
	return &storage.Encryption{
		Services:           toStorageEncryptedServices(e.Services),
		KeySource:          e.KeySource,
		KeyVaultProperties: toStorageKeyVaultProperties(e.KeyVaultProperties),
	}
}
type Endpoints struct {
	Blob string `json:"blob,omitempty"`
	Queue string `json:"queue,omitempty"`
	Table string `json:"table,omitempty"`
	File string `json:"file,omitempty"`
}
func newEndpoints(ep *storage.Endpoints) *Endpoints {
	if ep == nil {
		return nil
	}
	return &Endpoints{
		Blob:  to.String(ep.Blob),
		Queue: to.String(ep.Queue),
		Table: to.String(ep.Table),
		File:  to.String(ep.File),
	}
}
type Identity struct {
	PrincipalID string `json:"principalId,omitempty"`
	TenantID string `json:"tenantId,omitempty"`
	Type string `json:"type,omitempty"`
}
func newIdentity(s *storage.Identity) *Identity {
	if s == nil {
		return nil
	}
	return &Identity{
		PrincipalID: to.String(s.PrincipalID),
		TenantID:    to.String(s.TenantID),
		Type:        to.String(s.Type),
	}
}