@@ -50,20 +50,6 @@ func (ccdr *CreateCustomDomainRequest) Validate() error {
|
||||
return v.Error()
|
||||
}
|
||||
|
||||
func NewCustomDomainService(
|
||||
svc *TenantService,
|
||||
acmeService *certmanager.ACMEService,
|
||||
encryptionKey cipher.EncryptionKey,
|
||||
logger *log.Logger,
|
||||
) *CustomDomainService {
|
||||
return &CustomDomainService{
|
||||
svc: svc,
|
||||
acmeService: acmeService,
|
||||
encryptionKey: encryptionKey,
|
||||
logger: logger.Named("custom_domain"),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *CustomDomainService) CreateCustomDomain(
|
||||
ctx context.Context,
|
||||
req CreateCustomDomainRequest,
|
||||
|
||||
@@ -36,10 +36,6 @@ type (
|
||||
fileValidator *filevalidation.FileValidator
|
||||
}
|
||||
|
||||
CreateOrganizationRequest struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
UpdateOrganizationRequest struct {
|
||||
ID gid.GID
|
||||
Name *string
|
||||
@@ -57,14 +53,6 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
func (cor *CreateOrganizationRequest) Validate() error {
|
||||
v := validator.New()
|
||||
|
||||
v.Check(cor.Name, "name", validator.Required(), validator.SafeTextNoNewLine(TitleMaxLength))
|
||||
|
||||
return v.Error()
|
||||
}
|
||||
|
||||
func (uor *UpdateOrganizationRequest) Validate() error {
|
||||
v := validator.New()
|
||||
|
||||
|
||||
@@ -30,21 +30,12 @@ type SnapshotService struct {
|
||||
svc *TenantService
|
||||
}
|
||||
|
||||
type (
|
||||
CreateSnapshotRequest struct {
|
||||
OrganizationID gid.GID
|
||||
Name string
|
||||
Description *string
|
||||
Type coredata.SnapshotsType
|
||||
}
|
||||
|
||||
UpdateSnapshotRequest struct {
|
||||
ID gid.GID
|
||||
Name *string
|
||||
Description **string
|
||||
Type *coredata.SnapshotsType
|
||||
}
|
||||
)
|
||||
type CreateSnapshotRequest struct {
|
||||
OrganizationID gid.GID
|
||||
Name string
|
||||
Description *string
|
||||
Type coredata.SnapshotsType
|
||||
}
|
||||
|
||||
func (csr *CreateSnapshotRequest) Validate() error {
|
||||
v := validator.New()
|
||||
@@ -57,17 +48,6 @@ func (csr *CreateSnapshotRequest) Validate() error {
|
||||
return v.Error()
|
||||
}
|
||||
|
||||
func (usr *UpdateSnapshotRequest) Validate() error {
|
||||
v := validator.New()
|
||||
|
||||
v.Check(usr.ID, "id", validator.Required(), validator.GID(coredata.SnapshotEntityType))
|
||||
v.Check(usr.Name, "name", validator.SafeTextNoNewLine(TitleMaxLength))
|
||||
v.Check(usr.Description, "description", validator.SafeText(ContentMaxLength))
|
||||
v.Check(usr.Type, "type", validator.OneOfSlice(coredata.SnapshotsTypes()))
|
||||
|
||||
return v.Error()
|
||||
}
|
||||
|
||||
func (s *SnapshotService) Get(
|
||||
ctx context.Context,
|
||||
snapshotID gid.GID,
|
||||
|
||||
@@ -58,14 +58,6 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
func (ctcar *CreateTrustCenterAccessRequest) Validate() error {
|
||||
v := validator.New()
|
||||
|
||||
v.Check(ctcar.TrustCenterID, "trust_center_id", validator.Required(), validator.GID(coredata.TrustCenterEntityType))
|
||||
|
||||
return v.Error()
|
||||
}
|
||||
|
||||
func (utcar *UpdateTrustCenterAccessRequest) Validate() error {
|
||||
v := validator.New()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user