GetDataClassificationSetting gets the data classification setting.
(ctx context.Context, workspaceID string)
| 182 | |
| 183 | // GetDataClassificationSetting gets the data classification setting. |
| 184 | func (s *Store) GetDataClassificationSetting(ctx context.Context, workspaceID string) (*storepb.DataClassificationSetting, error) { |
| 185 | setting, err := s.GetSetting(ctx, workspaceID, storepb.SettingName_DATA_CLASSIFICATION) |
| 186 | if err != nil { |
| 187 | return nil, errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_DATA_CLASSIFICATION) |
| 188 | } |
| 189 | if setting == nil { |
| 190 | return &storepb.DataClassificationSetting{}, nil |
| 191 | } |
| 192 | |
| 193 | val, ok := setting.Value.(*storepb.DataClassificationSetting) |
| 194 | if !ok { |
| 195 | return nil, errors.Errorf("invalid setting value type for %s", storepb.SettingName_DATA_CLASSIFICATION) |
| 196 | } |
| 197 | return val, nil |
| 198 | } |
| 199 | |
| 200 | func (s *Store) GetAISetting(ctx context.Context, workspaceID string) (*storepb.AISetting, error) { |
| 201 | setting, err := s.GetSetting(ctx, workspaceID, storepb.SettingName_AI) |
no test coverage detected