GetWorkspaceApprovalSetting gets the workspace approval setting.
(ctx context.Context, workspaceID string)
| 148 | |
| 149 | // GetWorkspaceApprovalSetting gets the workspace approval setting. |
| 150 | func (s *Store) GetWorkspaceApprovalSetting(ctx context.Context, workspaceID string) (*storepb.WorkspaceApprovalSetting, error) { |
| 151 | setting, err := s.GetSetting(ctx, workspaceID, storepb.SettingName_WORKSPACE_APPROVAL) |
| 152 | if err != nil { |
| 153 | return nil, errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_WORKSPACE_APPROVAL) |
| 154 | } |
| 155 | if setting == nil { |
| 156 | return nil, errors.Errorf("cannot find setting %v", storepb.SettingName_WORKSPACE_APPROVAL) |
| 157 | } |
| 158 | |
| 159 | val, ok := setting.Value.(*storepb.WorkspaceApprovalSetting) |
| 160 | if !ok { |
| 161 | return nil, errors.Errorf("invalid setting value type for %s", storepb.SettingName_WORKSPACE_APPROVAL) |
| 162 | } |
| 163 | return val, nil |
| 164 | } |
| 165 | |
| 166 | // GetSemanticTypesSetting gets the semantic types setting. |
| 167 | func (s *Store) GetSemanticTypesSetting(ctx context.Context, workspaceID string) (*storepb.SemanticTypeSetting, error) { |
no test coverage detected