Skip to content

Commit

Permalink
chore: update protos dependency (#108)
Browse files Browse the repository at this point in the history
This updates to the latest protos. These properly namespace the protos
to `Momento.Protos`, hence the updates necessary to the client code
here.
  • Loading branch information
malandis authored Aug 11, 2022
1 parent 2e8d77c commit 70676fb
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 34 deletions.
6 changes: 3 additions & 3 deletions Momento/Incubating/Internal/ScsDataClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CacheClient;
using Google.Protobuf;
using Momento.Protos.CacheClient;
using MomentoSdk.Exceptions;
using MomentoSdk.Incubating.Responses;
using MomentoSdk.Internal;
using MomentoSdk.Internal.ExtensionMethods;
using MomentoSdk.Incubating.Responses;
using MomentoSdk.Exceptions;

namespace MomentoSdk.Incubating.Internal;

Expand Down
4 changes: 2 additions & 2 deletions Momento/Incubating/Responses/CacheDictionaryFetchResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using Google.Protobuf.Collections;
using CacheClient;
using MomentoSdk.Responses;
using Momento.Protos.CacheClient;
using MomentoSdk.Internal;
using MomentoSdk.Responses;

namespace MomentoSdk.Incubating.Responses;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using CacheClient;
using Momento.Protos.CacheClient;
using MomentoSdk.Responses;


Expand Down
6 changes: 3 additions & 3 deletions Momento/Incubating/Responses/CacheDictionaryGetResponse.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using CacheClient;
using Google.Protobuf;
using MomentoSdk.Responses;
using Google.Protobuf;
using Momento.Protos.CacheClient;
using MomentoSdk.Exceptions;
using MomentoSdk.Responses;

namespace MomentoSdk.Incubating.Responses;

Expand Down
2 changes: 1 addition & 1 deletion Momento/Incubating/Responses/CacheSetFetchResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using Google.Protobuf;
using Google.Protobuf.Collections;
using CacheClient;
using Momento.Protos.CacheClient;
using MomentoSdk.Internal;
using MomentoSdk.Responses;

Expand Down
4 changes: 2 additions & 2 deletions Momento/Internal/ControlGrpcManager.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using Grpc.Core;
using Grpc.Core.Interceptors;
using Grpc.Net.Client;
using ControlClient;
using System.Collections.Generic;
using Momento.Protos.ControlClient;
using static System.Reflection.Assembly;

namespace MomentoSdk.Internal;
Expand Down
4 changes: 2 additions & 2 deletions Momento/Internal/DataGrpcManager.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using CacheClient;
using System.Collections.Generic;
using Grpc.Core;
using Grpc.Core.Interceptors;
using Grpc.Net.Client;
using System.Collections.Generic;
using Momento.Protos.CacheClient;
using static System.Reflection.Assembly;

namespace MomentoSdk.Internal;
Expand Down
6 changes: 3 additions & 3 deletions Momento/Internal/ScsControlClient.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using MomentoSdk.Responses;
using Momento.Protos.ControlClient;
using MomentoSdk.Exceptions;
using ControlClient;
using MomentoSdk.Responses;

namespace MomentoSdk.Internal;

Expand Down Expand Up @@ -51,7 +51,7 @@ public ListCachesResponse ListCaches(string? nextPageToken = null)
_ListCachesRequest request = new _ListCachesRequest() { NextToken = nextPageToken == null ? "" : nextPageToken };
try
{
ControlClient._ListCachesResponse result = this.grpcManager.Client.ListCaches(request, deadline: CalculateDeadline());
_ListCachesResponse result = this.grpcManager.Client.ListCaches(request, deadline: CalculateDeadline());
return new ListCachesResponse(result);
}
catch (Exception e)
Expand Down
10 changes: 5 additions & 5 deletions Momento/Internal/ScsDataClient.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MomentoSdk.Internal.ExtensionMethods;
using MomentoSdk.Responses;
using MomentoSdk.Exceptions;
using CacheClient;
using Google.Protobuf;
using Grpc.Core;
using System.Collections.Generic;
using Momento.Protos.CacheClient;
using MomentoSdk.Exceptions;
using MomentoSdk.Internal.ExtensionMethods;
using MomentoSdk.Responses;

namespace MomentoSdk.Internal;

Expand Down
2 changes: 1 addition & 1 deletion Momento/MomentoSdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<PackageReference Include="Google.Protobuf" Version="3.19.0" />
<PackageReference Include="Grpc.Net.Client" Version="2.40.0" />
<PackageReference Include="Grpc.Core" Version="2.41.1" />
<PackageReference Include="Momento.Protos" Version="0.23.2" />
<PackageReference Include="Momento.Protos" Version="0.25.0" />
<PackageReference Include="JWT" Version="8.4.2" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.16.0" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Momento/Responses/CacheGetResponse.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using CacheClient;
using Google.Protobuf;
using Google.Protobuf;
using Momento.Protos.CacheClient;

namespace MomentoSdk.Responses;

Expand Down
2 changes: 1 addition & 1 deletion Momento/Responses/CacheGetStatus.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CacheClient;
using Momento.Protos.CacheClient;
using MomentoSdk.Exceptions;

namespace MomentoSdk.Responses;
Expand Down
4 changes: 1 addition & 3 deletions Momento/Responses/CacheSetResponse.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using CacheClient;

namespace MomentoSdk.Responses;
namespace MomentoSdk.Responses;

public class CacheSetResponse
{
Expand Down
5 changes: 3 additions & 2 deletions Momento/Responses/ListCachesResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using Momento.Protos.ControlClient;

namespace MomentoSdk.Responses;

Expand All @@ -7,11 +8,11 @@ public class ListCachesResponse
public List<CacheInfo> Caches { get; }
public string? NextPageToken { get; }

public ListCachesResponse(ControlClient._ListCachesResponse result)
public ListCachesResponse(_ListCachesResponse result)
{
NextPageToken = result.NextToken == "" ? null : result.NextToken;
Caches = new List<CacheInfo>();
foreach (ControlClient._Cache c in result.Cache)
foreach (_Cache c in result.Cache)
{
Caches.Add(new CacheInfo(c.CacheName));
}
Expand Down
6 changes: 3 additions & 3 deletions MomentoTest/Responses/CacheGetResponseTest.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using CacheClient;
using Google.Protobuf;
using Xunit;
using Google.Protobuf;
using Momento.Protos.CacheClient;
using MomentoSdk.Exceptions;
using MomentoSdk.Responses;
using Xunit;

namespace MomentoTest.Responses;

Expand Down

0 comments on commit 70676fb

Please sign in to comment.