Skip to content

Commit 15358cf

Browse files
sfe/salesforce: Remove donation call-to-action and Cases support
1 parent c62e796 commit 15358cf

16 files changed

Lines changed: 38 additions & 1086 deletions

File tree

cmd/email-exporter/main.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,6 @@ func (s legacyEmailExporterServer) SendContacts(ctx context.Context, req *emailp
8080
return s.inner.SendContacts(ctx, &salesforcepb.SendContactsRequest{Emails: req.GetEmails()})
8181
}
8282

83-
// SendCase is an interface adapter that forwards the request to the same method
84-
// on the inner salesforce.Exporter server.
85-
func (s legacyEmailExporterServer) SendCase(ctx context.Context, req *emailpb.SendCaseRequest) (*emptypb.Empty, error) {
86-
return s.inner.SendCase(ctx, &salesforcepb.SendCaseRequest{
87-
Origin: req.GetOrigin(),
88-
Subject: req.GetSubject(),
89-
Description: req.GetDescription(),
90-
ContactEmail: req.GetContactEmail(),
91-
Organization: req.GetOrganization(),
92-
AccountId: req.GetAccountId(),
93-
RateLimitName: req.GetRateLimitName(),
94-
RateLimitTier: req.GetRateLimitTier(),
95-
UseCase: req.GetUseCase(),
96-
})
97-
}
98-
9983
func main() {
10084
configFile := flag.String("config", "", "Path to configuration file")
10185
grpcAddr := flag.String("addr", "", "gRPC listen address override")

mocks/emailexporter.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ var _ salesforce.SalesforceClient = (*MockSalesforceClientImpl)(nil)
1818
type MockSalesforceClientImpl struct {
1919
sync.Mutex
2020
CreatedContacts []string
21-
CreatedCases []salesforce.Case
2221
}
2322

2423
// NewMockSalesforceClientImpl returns a MockSalesforceClientImpl, which implements
@@ -47,25 +46,6 @@ func (m *MockSalesforceClientImpl) GetCreatedContacts() []string {
4746
return slices.Clone(m.CreatedContacts)
4847
}
4948

50-
// SendCase adds a case payload to CreatedCases.
51-
func (m *MockSalesforceClientImpl) SendCase(payload salesforce.Case) error {
52-
m.Lock()
53-
defer m.Unlock()
54-
55-
m.CreatedCases = append(m.CreatedCases, payload)
56-
return nil
57-
}
58-
59-
// GetCreatedCases is used for testing to retrieve the list of created cases in
60-
// a thread-safe manner.
61-
func (m *MockSalesforceClientImpl) GetCreatedCases() []salesforce.Case {
62-
m.Lock()
63-
defer m.Unlock()
64-
65-
// Return a copy to avoid race conditions.
66-
return slices.Clone(m.CreatedCases)
67-
}
68-
6949
var _ salesforcepb.ExporterClient = (*MockExporterClientImpl)(nil)
7050

7151
// MockExporterClientImpl is a mock implementation of ExporterClient.
@@ -91,18 +71,3 @@ func (m *MockExporterClientImpl) SendContacts(ctx context.Context, req *salesfor
9171
}
9272
return &emptypb.Empty{}, nil
9373
}
94-
95-
// SendCase submits a Case using the inner salesforce.SalesforceClient.
96-
func (m *MockExporterClientImpl) SendCase(ctx context.Context, req *salesforcepb.SendCaseRequest, _ ...grpc.CallOption) (*emptypb.Empty, error) {
97-
return &emptypb.Empty{}, m.SalesforceClient.SendCase(salesforce.Case{
98-
Origin: req.Origin,
99-
Subject: req.Subject,
100-
Description: req.Description,
101-
ContactEmail: req.ContactEmail,
102-
Organization: req.Organization,
103-
AccountId: req.AccountId,
104-
RateLimitName: req.RateLimitName,
105-
RateLimitTier: req.RateLimitTier,
106-
UseCase: req.UseCase,
107-
})
108-
}

salesforce/email/proto/emailexporter.pb.go

Lines changed: 16 additions & 150 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

salesforce/email/proto/emailexporter.proto

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,8 @@ import "google/protobuf/empty.proto";
1313

1414
service Exporter {
1515
rpc SendContacts (SendContactsRequest) returns (google.protobuf.Empty);
16-
rpc SendCase (SendCaseRequest) returns (google.protobuf.Empty);
1716
}
1817

1918
message SendContactsRequest {
2019
repeated string emails = 1;
2120
}
22-
23-
message SendCaseRequest {
24-
string origin = 1;
25-
string subject = 2;
26-
string description = 3;
27-
string contactEmail = 4;
28-
string organization = 5;
29-
string accountId = 6;
30-
string rateLimitName = 7;
31-
string rateLimitTier = 8;
32-
string useCase = 9;
33-
}
34-

salesforce/email/proto/emailexporter_grpc.pb.go

Lines changed: 0 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)